ohibc logo
OHI British Columbia | OHI Science | Citation policy


dir_git <- '~/github/provRmd'
library(dplyr)
library(readr)
library(stringr)

dir_test <- file.path(dir_git, 'rmd_testing')

### set up provenance tracking for this script:
# document(); install()
library(provRmd)
prov_setup()### initializes prov_track and loads functions

1 read a table; capture prov info

table1_file <- file.path(dir_test, 'table1.csv')
table1      <- read.csv(table1_file, stringsAsFactors = FALSE)

table2_file <- file.path(dir_test, 'table2.csv')
write.csv(table1, table2_file)

table3_file <- file.path(dir_test, 'table3.csv')
write.csv(table1, table3_file)
source(file.path(dir_test, 'test_source.R'))
DT::datatable(table1,   ### does not display system and session info
              caption  = 'this is a sample table:',              
              rownames = FALSE,
              class    = 'stripe hover compact',
              options  = list(dom = 'tp'))

3 Provenance

this is a dummy footer document.

Done.


footer_fun <- function() {
  y <- system.file('footer/prov_ftr3.Rmd', package = 'provRmd'); message('footer 3 exists? ', file.exists(y))
  x <- knitr::knit_child(y)
  return(x)
}

4 Provenance

these footers do not work:

`.r knit_child('prov/prov_ftr1.Rmd')`

`.r prov_wrapup()`

.```{r footer}
  prov_wrapup()
.```